<template>
  <!-- 咨询师详情 -->
  <div class="consultant_list">
    <Header />
    <div class="consultant_list_about">
      <div class="consultant_detail">
        <div class="img">
          <!-- <img :src="baseURL + consultantInfo.top.head_pic" alt="" /> -->
        </div>
        <div class="gender">
          <span>{{ consultantInfo.top.nickname }}</span>
          &nbsp;&nbsp;
          <span v-if="(consultantInfo.top.sex = 1)">男</span>
          <span v-if="(consultantInfo.top.sex = 0)">女</span>
          <img
            v-if="(consultantInfo.top.sex = 1)"
            src="../assets/image/Component 141.png"
            alt=""
          />
          <img
            v-if="(consultantInfo.top.sex = 0)"
            src="../assets/image/Component 142.png"
            alt=""
          />
        </div>
        <div class="consultant_about">
          <img
            v-if="
              consultantInfo.top.cons_attrb_id == '金牌咨询师' ||
              consultantInfo.top.cons_attrb_id == '注册会计师' ||
              consultantInfo.top.cons_attrb_id == '高级审计师' ||
              consultantInfo.top.cons_attrb_id == '金牌律师'
            "
            src="../assets/image/Component 119.png"
            alt=""
          />
          <img
            v-if="
              consultantInfo.top.cons_attrb_id == '高级咨询师' ||
              consultantInfo.top.cons_attrb_id == '会计师' ||
              consultantInfo.top.cons_attrb_id == '审计师' ||
              consultantInfo.top.cons_attrb_id == '高级律师'
            "
            src="../assets/image/Component 120.png"
            alt=""
          />
          <img
            v-if="
              consultantInfo.top.cons_attrb_id == '咨询师' ||
              consultantInfo.top.cons_attrb_id == '律师'
            "
            src="../assets/image/Component 121 (1).png"
            alt=""
          />
          <span>{{ consultantInfo.top.cons_attra_id }}</span>
          <span>{{ consultantInfo.top.cons_attrb_id }}</span>
        </div>
        <div class="consultant_help">
          <div class="consultant_help_left">
            帮助人数：<span>{{ consultantInfo.top.help_num }}</span>
          </div>
          <div class="consultant_help_right">
            经验时间：<span>{{ consultantInfo.top.work_year }}年</span>
          </div>
        </div>
      </div>
      <div class="consult_data">
        <div class="consultant_data">
          <div class="consult_data_left">
            {{ consultantInfo.top.voucher.title }}
          </div>
          <div class="consult_data_right">
            <div
              class="consult_data_right_item"
              v-for="(item, index) in consultantInfo.top.voucher.content"
              :key="index"
            >
              <div class="consult_data_right_item_img">
                <img :src="'http://lds.vipkdj.com/' + item" alt="" />
              </div>
            </div>
          </div>
        </div>
        <van-row
          v-for="(item, index) in consultantInfo.bottom"
          :key="index"
          type="flex"
          justify="left"
        >
          <van-col span="5">{{ item.title }}</van-col>
          <van-col span="18">{{ item.content }}</van-col>
        </van-row>
      </div>
    </div>
  </div>
</template>

<script>
import { getUserinfo } from "../api/index/index";
export default {
  data() {
    return {
      baseURL: this.$store.state.baseURL,
      shower: "1",
      consultantInfo: {},
      tupe: "",
    };
  },
  mounted() {
    let vm = this;
    vm.type = vm.$route.query.id;
    //咨询师详情
    vm.getConsultantInfo();
  },
  methods: {
    //咨询师详情请求
    async getConsultantInfo() {
      console.log(this.type);
      let vm = this;
      let data = { id: vm.type };
      const res = await getUserinfo(data);
      console.log(res, "咨询师详情");
      vm.consultantInfo = res.data.data;
      this.$toast(res.data.msg);
    },
  },
};
</script>

<style lang="less" scoped>
.consultant_list_about {
  width: 341px;
  margin-left: 16px;
  .consultant_detail {
    .img {
      margin-left: 136px;
      margin-top: 21px;
      img {
        width: 67px;
        height: 99px;
      }
    }
    .gender {
      margin-left: 136px;
      margin-top: 12px;
      img {
        display: inline;
        margin-bottom: -4px;
        border: 1px dotted #e7e7e7;
      }
    }
    .consultant_about {
      margin-left: 96px;
      margin-top: 10px;
      img {
        margin-bottom: -4px;
      }
    }
    .consultant_help {
      margin-left: 65px;
      margin-top: 13px;
      display: flex;
      justify-content: flex-start;
      align-content: center;
      flex-wrap: nowrap;
      .consultant_help_left {
        span {
          font-size: 13px;
          line-height: 19px;
          color: #c4181f;
        }
      }
      .consultant_help_right {
        margin-left: 26px;
        span {
          font-size: 13px;
          line-height: 19px;
          color: #c4181f;
        }
      }
    }
  }
  .consult_data {
    width: 341px;
    margin-top: 15px;
    border-top: 1px solid #dcdcdc;

    .consultant_data {
      display: flex;
      .consult_data_left {
        margin-top: 21px;
        width: 75px;
        font-size: 14px;
        line-height: 21px;
        font-weight: 400;
      }
      .consult_data_right {
        display: flex;
        flex-wrap: nowrap;
        max-width: 70vw;
        overflow-x: scroll;
        overflow-y: hidden;
        &::-webkit-scrollbar {
          display: none;
        }
        .consult_data_right_item {
          //margin:上右下左
          margin: 25px 2px 0;
          .consult_data_right_item_img {
            img {
              width: 87px;
              height: 60px;
            }
          }
        }
      }
    }
    .van-row {
      margin-top: 21px;
      .van-col {
        font-size: 14px;
        line-height: 21px;
      }
      .van-col--18 {
        color: #9f9f9f;
      }
    }
  }
}
</style>